/**
 * 模拟耗时的操作，分时间片，w3c UI响应< 50ms 不产生阻塞
 * @param {HTMLElement} msg
 * @param {number} curTotal
 * @param {number} curIndex
 */
function done(msg,corTotal,curIndex){
    if(curTotal<=0){
        msg.innerHTML+="操作完成";
        return;
    }
    let count=Math.min(curTotal,500000);
    setTimeout(function(){
        let start=performance.now();
        let myDate;
        for(let i=0;i<count;i++){
            let date=new Date();
            myDate=date;
        }
        let end=performance.now();
        console.log(`耗时${end-start}ms，当前剩余${curTotal-count}`);
        done(msg,curTotal-count,curIndex+count);
    },0);
}